package Modele;

import java.util.Comparator;

public class AlphaComparator implements Comparator{
	
	 AlphaComparator()
	  {
	  }
	 
	  public int compare(Object arg0, Object arg1) 
	  {
	    Contact p1 = (Contact) arg0;
	    Contact p2 = (Contact) arg1;
	    
	    int result = p1.getPrenom().compareTo(p2.getPrenom());
	    
	    if(result==0)
	      result = p1.getNom().compareTo(p2.getNom());
	    
	  	return result;
	  }

	
}
